﻿using System.Data;
using DbVisualizer.Table;
using Microsoft.VisualStudio.DebuggerVisualizers;

[assembly: System.Diagnostics.DebuggerVisualizer(
    typeof(DataTableVisualizer),
    typeof(VisualizerObjectSource),
    Target = typeof(DataTable),
    Description = "View DataTable")]

namespace DbVisualizer.Table
{
    public class DataTableVisualizer : DialogDebuggerVisualizer
    {
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            var ui = new DataTableViewer((DataTable)objectProvider.GetObject());

            windowService.ShowDialog(ui);
        }
    }
}
